package page.app.wallet;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.ExpectedConditions;

import basicTool.WaitTool;
import io.appium.java_client.AppiumDriver;
import page.app.AbstractAppPage;

public class PacketAndTicketPage extends AbstractAppPage{
	@FindBy(xpath= "//UIAStaticText[@name='红包卡券']|//android.widget.TextView[@text='红包卡券']")
	private WebElement title;
	
	@FindBy(xpath= "//UIAButton[@name='历史']|//android.widget.TextView[@text='历史']")
	private WebElement history;
	
	@FindBy(xpath= "//UIAStaticText[@name='红包卡券']|//android.widget.TextView[@text='红包卡券']")
	private WebElement packetAndTicket;
	
	
	public PacketAndTicketPage(AppiumDriver appiumDriver) {
        super(appiumDriver);
        WaitTool.waitFor(appiumDriver, ExpectedConditions.visibilityOf(title), DefaultWaitElementTime4Page);
    }
	public void IntoPacketPage() throws Exception{
		super.swipe(4,1);
		WaitTool.waitFor(appiumDriver, ExpectedConditions.visibilityOf(title), DefaultWaitElementTime4Page);	
	}
	
	public PacketAndTicketHistoryPage IntoHistoryPage() throws Exception {
		return click(history,PacketAndTicketHistoryPage.class);
	}
	
	
}
